#include <gtest/gtest.h>

#include "sort/sort.h"

class SortTest : public ::testing::Test
{
  protected:
    void SetUp() override
    {
        // 初始化代码 (需要时)
    }
};

TEST_F(SortTest, CountingSortTest)
{
    const int len = 15;
    const int maxValue = 10;
    int arr[len];

    // 初始化随机数组
    for (int i = 0; i < len; i++)
    {
        arr[i] = rand() % (maxValue + 1);
    }

    countingSort(arr, len, maxValue);

    // 验证排序结果
    for (int i = 0; i < len - 1; i++)
    {
        EXPECT_LE(arr[i], arr[i + 1]);
    }
}